/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  @endpointMap = {
    ap-southeast-1 = 'oms.ap-southeast-1.aliyuncs.com',
    cn-hangzhou = 'pre-oms.cn-hangzhou.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('oms', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CheckReadyFlagRequest {
  cycles?: int32(name='Cycles'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  endTime?: long(name='EndTime'),
  period?: string(name='Period'),
  startTime?: long(name='StartTime'),
}

model CheckReadyFlagResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model CheckReadyFlagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CheckReadyFlagResponseBody(name='body'),
}

async function checkReadyFlagWithOptions(request: CheckReadyFlagRequest, runtime: Util.RuntimeOptions): CheckReadyFlagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cycles)) {
    query['Cycles'] = request.cycles;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckReadyFlag',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkReadyFlag(request: CheckReadyFlagRequest): CheckReadyFlagResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkReadyFlagWithOptions(request, runtime);
}

model DeleteDomainPartRequest {
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  part?: string(name='Part'),
}

model DeleteDomainPartResponseBody = {
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model DeleteDomainPartResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDomainPartResponseBody(name='body'),
}

async function deleteDomainPartWithOptions(request: DeleteDomainPartRequest, runtime: Util.RuntimeOptions): DeleteDomainPartResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.part)) {
    query['Part'] = request.part;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomainPart',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDomainPart(request: DeleteDomainPartRequest): DeleteDomainPartResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainPartWithOptions(request, runtime);
}

model DeleteDomainPartByProxyRequest {
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  part?: string(name='Part'),
}

model DeleteDomainPartByProxyResponseBody = {
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model DeleteDomainPartByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDomainPartByProxyResponseBody(name='body'),
}

async function deleteDomainPartByProxyWithOptions(request: DeleteDomainPartByProxyRequest, runtime: Util.RuntimeOptions): DeleteDomainPartByProxyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.part)) {
    query['Part'] = request.part;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomainPartByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDomainPartByProxy(request: DeleteDomainPartByProxyRequest): DeleteDomainPartByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainPartByProxyWithOptions(request, runtime);
}

model DeleteMeasureDataRequest {
  apiType?: string(name='ApiType', example='Full'),
  compressed?: boolean(name='Compressed', example='false'),
  data?: string(name='Data', example='[{"UserId":"1192922887522200","ProductId":"VM","StartTime":"1556640000","EndTime":"1556726400","Region":"cn-hangzhou","InstanceId":"test1","CPU":"4"}]'),
  dataType?: string(name='DataType', example='raw'),
  domainCode?: string(name='DomainCode', description='OMS Domain', example='VM'),
  filter?: string(name='Filter', example='StartTime>1469980800;StartTime<1469984400'),
}

model DeleteMeasureDataResponseBody = {
  apiType?: string(name='ApiType', example='Full'),
  dataType?: string(name='DataType', example='raw'),
  domainCode?: string(name='DomainCode', description='OMS Domain', example='VM'),
  requestId?: string(name='RequestId', description='Id of the request', example='1111-1111-1111'),
  total?: long(name='Total', example='100'),
}

model DeleteMeasureDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteMeasureDataResponseBody(name='body'),
}

async function deleteMeasureDataWithOptions(request: DeleteMeasureDataRequest, runtime: Util.RuntimeOptions): DeleteMeasureDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMeasureData',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteMeasureData(request: DeleteMeasureDataRequest): DeleteMeasureDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMeasureDataWithOptions(request, runtime);
}

model GetAccessPolicyConfigRequest {
  aliUid?: string(name='AliUid'),
  compressEnable?: boolean(name='CompressEnable'),
}

model GetAccessPolicyConfigResponseBody = {
  aliUid?: string(name='AliUid'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetAccessPolicyConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAccessPolicyConfigResponseBody(name='body'),
}

async function getAccessPolicyConfigWithOptions(request: GetAccessPolicyConfigRequest, runtime: Util.RuntimeOptions): GetAccessPolicyConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAccessPolicyConfig',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAccessPolicyConfig(request: GetAccessPolicyConfigRequest): GetAccessPolicyConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAccessPolicyConfigWithOptions(request, runtime);
}

model GetDomainConfigRequest {
  compressEnable?: boolean(name='CompressEnable'),
  domainCode?: string(name='DomainCode'),
}

model GetDomainConfigResponseBody = {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model GetDomainConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDomainConfigResponseBody(name='body'),
}

async function getDomainConfigWithOptions(request: GetDomainConfigRequest, runtime: Util.RuntimeOptions): GetDomainConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomainConfig',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDomainConfig(request: GetDomainConfigRequest): GetDomainConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDomainConfigWithOptions(request, runtime);
}

model GetDomainPartRequest {
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  part?: string(name='Part'),
}

model GetDomainPartResponseBody = {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model GetDomainPartResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDomainPartResponseBody(name='body'),
}

async function getDomainPartWithOptions(request: GetDomainPartRequest, runtime: Util.RuntimeOptions): GetDomainPartResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomainPart',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDomainPart(request: GetDomainPartRequest): GetDomainPartResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDomainPartWithOptions(request, runtime);
}

model GetDomainPartByProxyRequest {
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  part?: string(name='Part'),
}

model GetDomainPartByProxyResponseBody = {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model GetDomainPartByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDomainPartByProxyResponseBody(name='body'),
}

async function getDomainPartByProxyWithOptions(request: GetDomainPartByProxyRequest, runtime: Util.RuntimeOptions): GetDomainPartByProxyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compressEnable)) {
    query['CompressEnable'] = request.compressEnable;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.part)) {
    query['Part'] = request.part;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomainPartByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDomainPartByProxy(request: GetDomainPartByProxyRequest): GetDomainPartByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDomainPartByProxyWithOptions(request, runtime);
}

model GetDomainPartConfigRequest {
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  part?: string(name='Part'),
}

model GetDomainPartConfigResponseBody = {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model GetDomainPartConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDomainPartConfigResponseBody(name='body'),
}

async function getDomainPartConfigWithOptions(request: GetDomainPartConfigRequest, runtime: Util.RuntimeOptions): GetDomainPartConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomainPartConfig',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDomainPartConfig(request: GetDomainPartConfigRequest): GetDomainPartConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDomainPartConfigWithOptions(request, runtime);
}

model GetFileConfigRequest {
  dimensionType?: string(name='DimensionType'),
  domainCode?: string(name='DomainCode'),
}

model GetFileConfigResponseBody = {
  data?: string(name='Data'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetFileConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetFileConfigResponseBody(name='body'),
}

async function getFileConfigWithOptions(request: GetFileConfigRequest, runtime: Util.RuntimeOptions): GetFileConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFileConfig',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFileConfig(request: GetFileConfigRequest): GetFileConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getFileConfigWithOptions(request, runtime);
}

model GetIncrementMeasureDataByProxyRequest {
  compressEnable?: boolean(name='CompressEnable', example='false'),
  dataType?: string(name='DataType', example='hour'),
  domainCode?: string(name='DomainCode', example='XXDEMO'),
  modifyEndTime?: long(name='ModifyEndTime', example='1700634930'),
  modifyStartTime?: long(name='ModifyStartTime', example='1700634920'),
  rowKeyMapStr?: string(name='RowKeyMapStr', example='{\\"ProviderId\\":\\"26842\\",\\"InstanceId\\":\\"XXX\\",\\"UserId\\":123,\\"ProductId\\":\\"XX\\"}'),
}

model GetIncrementMeasureDataByProxyResponseBody = {
  compressed?: string(name='Compressed', example='false'),
  data?: string(name='Data', example='"[{\\"meteringData\\":{\\"ProviderId\\":\\"26842\\",\\"InstanceId\\":\\"XXX\\",\\"Size\\":\\"123\\",\\"UserId\\":\\"123\\",\\"ProductId\\":\\"XX\\"},\\"modifyTime\\":1700634920,\\"status\\":\\"Stop\\"}]"'),
  dataType?: string(name='DataType', example='hour'),
  domainCode?: string(name='DomainCode', example='XXDEMO'),
  requestId?: string(name='RequestId', description='Id of the request', example='645B25AB-4E09-5DCA-8443-A7A58138690B'),
}

model GetIncrementMeasureDataByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetIncrementMeasureDataByProxyResponseBody(name='body'),
}

async function getIncrementMeasureDataByProxyWithOptions(request: GetIncrementMeasureDataByProxyRequest, runtime: Util.RuntimeOptions): GetIncrementMeasureDataByProxyResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIncrementMeasureDataByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getIncrementMeasureDataByProxy(request: GetIncrementMeasureDataByProxyRequest): GetIncrementMeasureDataByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIncrementMeasureDataByProxyWithOptions(request, runtime);
}

model GetMeasureDataRequest {
  apiType?: string(name='ApiType'),
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  filter?: string(name='Filter'),
  maxResult?: int32(name='MaxResult'),
  nextToken?: string(name='NextToken'),
  queryField?: string(name='QueryField'),
}

model GetMeasureDataResponseBody = {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model GetMeasureDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMeasureDataResponseBody(name='body'),
}

async function getMeasureDataWithOptions(request: GetMeasureDataRequest, runtime: Util.RuntimeOptions): GetMeasureDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressEnable)) {
    query['CompressEnable'] = request.compressEnable;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.maxResult)) {
    query['MaxResult'] = request.maxResult;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.queryField)) {
    query['QueryField'] = request.queryField;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMeasureData',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMeasureData(request: GetMeasureDataRequest): GetMeasureDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMeasureDataWithOptions(request, runtime);
}

model GetOpenApiConfigRequest {
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  productName?: string(name='ProductName'),
  tableName?: string(name='TableName'),
  siteBid?: string(name='siteBid'),
}

model GetOpenApiConfigResponseBody = {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  productName?: string(name='ProductName'),
  requestId?: string(name='RequestId'),
  siteBid?: string(name='SiteBid'),
  tableName?: string(name='TableName'),
}

model GetOpenApiConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOpenApiConfigResponseBody(name='body'),
}

async function getOpenApiConfigWithOptions(request: GetOpenApiConfigRequest, runtime: Util.RuntimeOptions): GetOpenApiConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOpenApiConfig',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOpenApiConfig(request: GetOpenApiConfigRequest): GetOpenApiConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOpenApiConfigWithOptions(request, runtime);
}

model GetReadyFlagRequest {
  apiType?: string(name='ApiType'),
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  filter?: string(name='Filter'),
  maxResult?: int32(name='MaxResult'),
  nextToken?: string(name='NextToken'),
}

model GetReadyFlagResponseBody = {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model GetReadyFlagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetReadyFlagResponseBody(name='body'),
}

async function getReadyFlagWithOptions(request: GetReadyFlagRequest, runtime: Util.RuntimeOptions): GetReadyFlagResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetReadyFlag',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getReadyFlag(request: GetReadyFlagRequest): GetReadyFlagResponse {
  var runtime = new Util.RuntimeOptions{};
  return getReadyFlagWithOptions(request, runtime);
}

model GetReadyFlagAlertConfigRequest {
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
}

model GetReadyFlagAlertConfigResponseBody = {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model GetReadyFlagAlertConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetReadyFlagAlertConfigResponseBody(name='body'),
}

async function getReadyFlagAlertConfigWithOptions(request: GetReadyFlagAlertConfigRequest, runtime: Util.RuntimeOptions): GetReadyFlagAlertConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetReadyFlagAlertConfig',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getReadyFlagAlertConfig(request: GetReadyFlagAlertConfigRequest): GetReadyFlagAlertConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getReadyFlagAlertConfigWithOptions(request, runtime);
}

model GetReadyFlagByProxyRequest {
  apiType?: string(name='ApiType'),
  compressEnable?: boolean(name='CompressEnable'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  filter?: string(name='Filter'),
  maxResult?: int32(name='MaxResult'),
  nextToken?: string(name='NextToken'),
}

model GetReadyFlagByProxyResponseBody = {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model GetReadyFlagByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetReadyFlagByProxyResponseBody(name='body'),
}

async function getReadyFlagByProxyWithOptions(request: GetReadyFlagByProxyRequest, runtime: Util.RuntimeOptions): GetReadyFlagByProxyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressEnable)) {
    query['CompressEnable'] = request.compressEnable;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.maxResult)) {
    query['MaxResult'] = request.maxResult;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetReadyFlagByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getReadyFlagByProxy(request: GetReadyFlagByProxyRequest): GetReadyFlagByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return getReadyFlagByProxyWithOptions(request, runtime);
}

model PutDomainPartRequest {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
}

model PutDomainPartResponseBody = {
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model PutDomainPartResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PutDomainPartResponseBody(name='body'),
}

async function putDomainPartWithOptions(request: PutDomainPartRequest, runtime: Util.RuntimeOptions): PutDomainPartResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutDomainPart',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putDomainPart(request: PutDomainPartRequest): PutDomainPartResponse {
  var runtime = new Util.RuntimeOptions{};
  return putDomainPartWithOptions(request, runtime);
}

model PutDomainPartByProxyRequest {
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
}

model PutDomainPartByProxyResponseBody = {
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model PutDomainPartByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PutDomainPartByProxyResponseBody(name='body'),
}

async function putDomainPartByProxyWithOptions(request: PutDomainPartByProxyRequest, runtime: Util.RuntimeOptions): PutDomainPartByProxyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutDomainPartByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putDomainPartByProxy(request: PutDomainPartByProxyRequest): PutDomainPartByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return putDomainPartByProxyWithOptions(request, runtime);
}

model PutMeasureDataRequest {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  filter?: string(name='Filter'),
  sourceRequestId?: string(name='SourceRequestId'),
}

model PutMeasureDataResponseBody = {
  apiType?: string(name='ApiType'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
  sourceRequestId?: string(name='SourceRequestId'),
}

model PutMeasureDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PutMeasureDataResponseBody(name='body'),
}

async function putMeasureDataWithOptions(request: PutMeasureDataRequest, runtime: Util.RuntimeOptions): PutMeasureDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.sourceRequestId)) {
    query['SourceRequestId'] = request.sourceRequestId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutMeasureData',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putMeasureData(request: PutMeasureDataRequest): PutMeasureDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMeasureDataWithOptions(request, runtime);
}

model PutMeasureDataByProxyRequest {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  filter?: string(name='Filter'),
}

model PutMeasureDataByProxyResponseBody = {
  apiType?: string(name='ApiType'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model PutMeasureDataByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PutMeasureDataByProxyResponseBody(name='body'),
}

async function putMeasureDataByProxyWithOptions(request: PutMeasureDataByProxyRequest, runtime: Util.RuntimeOptions): PutMeasureDataByProxyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutMeasureDataByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putMeasureDataByProxy(request: PutMeasureDataByProxyRequest): PutMeasureDataByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMeasureDataByProxyWithOptions(request, runtime);
}

model PutReadyFlagRequest {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  sourceRequestId?: string(name='SourceRequestId'),
}

model PutReadyFlagResponseBody = {
  apiType?: string(name='ApiType'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
  sourceRequestId?: string(name='SourceRequestId'),
}

model PutReadyFlagResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PutReadyFlagResponseBody(name='body'),
}

async function putReadyFlagWithOptions(request: PutReadyFlagRequest, runtime: Util.RuntimeOptions): PutReadyFlagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  if (!Util.isUnset(request.sourceRequestId)) {
    query['SourceRequestId'] = request.sourceRequestId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutReadyFlag',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putReadyFlag(request: PutReadyFlagRequest): PutReadyFlagResponse {
  var runtime = new Util.RuntimeOptions{};
  return putReadyFlagWithOptions(request, runtime);
}

model PutReadyFlagByProxyRequest {
  apiType?: string(name='ApiType'),
  compressed?: boolean(name='Compressed'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
}

model PutReadyFlagByProxyResponseBody = {
  apiType?: string(name='ApiType'),
  dataType?: string(name='DataType'),
  domainCode?: string(name='DomainCode'),
  requestId?: string(name='RequestId'),
}

model PutReadyFlagByProxyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PutReadyFlagByProxyResponseBody(name='body'),
}

async function putReadyFlagByProxyWithOptions(request: PutReadyFlagByProxyRequest, runtime: Util.RuntimeOptions): PutReadyFlagByProxyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiType)) {
    query['ApiType'] = request.apiType;
  }
  if (!Util.isUnset(request.compressed)) {
    query['Compressed'] = request.compressed;
  }
  if (!Util.isUnset(request.data)) {
    query['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.domainCode)) {
    query['DomainCode'] = request.domainCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutReadyFlagByProxy',
    version = '2016-06-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putReadyFlagByProxy(request: PutReadyFlagByProxyRequest): PutReadyFlagByProxyResponse {
  var runtime = new Util.RuntimeOptions{};
  return putReadyFlagByProxyWithOptions(request, runtime);
}

